class BannerModel {
// {
//     "errorCode": 0,
//     "errorMsg": ""
// }

  final List<Banner>? data;
  final num? errorCode;
  final String? errorMsg;

  BannerModel({
    this.data,
    this.errorCode,
    this.errorMsg,
  });

  factory BannerModel.fromJson(Map<String, dynamic> json) {
    return BannerModel(
      data: json['data'] == null
          ? null
          : List<Banner>.from(json['data'].map((x) => Banner.fromJson(x))),
      errorCode: json['errorCode'],
      errorMsg: json['errorMsg'],
    );
  }

  Map<String, dynamic> toJson() => {
        'data': data?.map((e) => e.toJson()).toList(),
        'errorCode': errorCode,
        'errorMsg': errorMsg,
      };
}

class Banner {
// {
//     "desc": "我们支持订阅啦~",
//     "id": 30,
//     "imagePath": "https://www.wanandroid.com/blogimgs/42da12d8-de56-4439-b40c-eab66c227a4b.png",
//     "isVisible": 1,
//     "order": 2,
//     "title": "我们支持订阅啦~",
//     "type": 0,
//     "url": "https://www.wanandroid.com/blog/show/3352"
// }

  final String? desc;
  final num? id;
  final String? imagePath;
  final num? isVisible;
  final num? order;
  final String? title;
  final num? type;
  final String? url;

  Banner({
    this.desc,
    this.id,
    this.imagePath,
    this.isVisible,
    this.order,
    this.title,
    this.type,
    this.url,
  });

  factory Banner.fromJson(Map<String, dynamic> json) {
    return Banner(
      desc: json['desc'],
      id: json['id'],
      imagePath: json['imagePath'],
      isVisible: json['isVisible'],
      order: json['order'],
      title: json['title'],
      type: json['type'],
      url: json['url'],
    );
  }

  Map<String, dynamic> toJson() => {
        'desc': desc,
        'id': id,
        'imagePath': imagePath,
        'isVisible': isVisible,
        'order': order,
        'title': title,
        'type': type,
        'url': url,
      };
}
